{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "data_t = pd.read_excel('./Evaluation Results-anonymous.xlsx', sheet_name='Teacher', index_col=0)\n",
    "\n",
    "evaluation_matrix = []\n",
    "for i in np.arange(1, 7):\n",
    "    g_name = \"G{0}\".format(i)\n",
    "    \n",
    "    data_gi = pd.read_excel('./Evaluation Results-anonymous.xlsx', sheet_name=g_name)\n",
    "    \n",
    "    eval_1 = np.sum(data_gi.loc[:,'Objective'])/len(data_gi.loc[:,'Objective']) + data_t.loc[g_name,'Objective']\n",
    "        \n",
    "    eval_2 = np.sum(data_gi.loc[:,'Cooperation'])/len(data_gi.loc[:,'Cooperation']) + data_t.loc[g_name,'Cooperation']\n",
    "        \n",
    "    eval_3 = np.sum(data_gi.loc[:,'Outcome'])/len(data_gi.loc[:,'Outcome']) + data_t.loc[g_name,'Outcome']\n",
    "    \n",
    "    score = np.sum([eval_1, eval_2, eval_3])\n",
    "                   \n",
    "    adjust_score = score / 3\n",
    "                   \n",
    "    performance_i = {\"Group Index\":g_name, \n",
    "                     \"Objective\":eval_1, \n",
    "                     \"Cooperation\":eval_2, \n",
    "                     \"Outcome\":eval_3,\n",
    "                     \"Score\": score,\n",
    "                     \"Adjust Score\": np.round(adjust_score,2)}\n",
    "    \n",
    "    evaluation_matrix.append(performance_i)\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Group Index</th>\n",
       "      <th>Objective</th>\n",
       "      <th>Cooperation</th>\n",
       "      <th>Outcome</th>\n",
       "      <th>Score</th>\n",
       "      <th>Adjust Score</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>G1</td>\n",
       "      <td>9.227273</td>\n",
       "      <td>6.863636</td>\n",
       "      <td>9.045455</td>\n",
       "      <td>25.136364</td>\n",
       "      <td>8.38</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>G2</td>\n",
       "      <td>9.478261</td>\n",
       "      <td>8.565217</td>\n",
       "      <td>9.347826</td>\n",
       "      <td>27.391304</td>\n",
       "      <td>9.13</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>G3</td>\n",
       "      <td>9.500000</td>\n",
       "      <td>7.909091</td>\n",
       "      <td>9.636364</td>\n",
       "      <td>27.045455</td>\n",
       "      <td>9.02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>G4</td>\n",
       "      <td>9.208333</td>\n",
       "      <td>8.208333</td>\n",
       "      <td>9.208333</td>\n",
       "      <td>26.625000</td>\n",
       "      <td>8.87</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>G5</td>\n",
       "      <td>9.400000</td>\n",
       "      <td>9.440000</td>\n",
       "      <td>9.320000</td>\n",
       "      <td>28.160000</td>\n",
       "      <td>9.39</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>G6</td>\n",
       "      <td>9.461538</td>\n",
       "      <td>9.576923</td>\n",
       "      <td>9.500000</td>\n",
       "      <td>28.538462</td>\n",
       "      <td>9.51</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  Group Index  Objective  Cooperation   Outcome      Score  Adjust Score\n",
       "0          G1   9.227273     6.863636  9.045455  25.136364          8.38\n",
       "1          G2   9.478261     8.565217  9.347826  27.391304          9.13\n",
       "2          G3   9.500000     7.909091  9.636364  27.045455          9.02\n",
       "3          G4   9.208333     8.208333  9.208333  26.625000          8.87\n",
       "4          G5   9.400000     9.440000  9.320000  28.160000          9.39\n",
       "5          G6   9.461538     9.576923  9.500000  28.538462          9.51"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.DataFrame(evaluation_matrix)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
